package cn.example.common.protocol.structs;

import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import org.artifact.core.lang.DTO;
@Data
/**
 * 玩家信息
 */
public class PlayerDTO implements DTO{
	/** 基本信息 */
	private PlayerInfoDTO playerInfo;
	/** 英雄 */
	private java.util.Map<java.lang.Long, HeroDTO> heros = new java.util.HashMap<>();
	/** 邮件 */
	private java.util.Map<java.lang.Long, MailDTO> mails = new java.util.HashMap<>();
	/** 道具 */
	private java.util.Map<java.lang.Long, PropDTO> props = new java.util.HashMap<>();
	/** 任务 */
	private java.util.Map<java.lang.Long, TaskDTO> tasks = new java.util.HashMap<>();
	/** 已提交的任务 */
	private java.util.List<java.lang.Long> submitTasks = new java.util.ArrayList<>();

	public Map<Object, Object> toMap(Map<Object, Object> map){
		map.put(2095520559,this.playerInfo);
		map.put(99168185,this.heros);
		map.put(103657884,this.mails);
		map.put(106940784,this.props);
		map.put(110132110,this.tasks);
		map.put(42834518,this.submitTasks);
	    return map;
	}

	public PlayerDTO forMap(Map<Object, Object> map){
        this.playerInfo = MapUtil.get(map ,2095520559,PlayerInfoDTO.class);
        this.heros = MapUtil.get(map ,99168185,java.util.Map.class);
        this.mails = MapUtil.get(map ,103657884,java.util.Map.class);
        this.props = MapUtil.get(map ,106940784,java.util.Map.class);
        this.tasks = MapUtil.get(map ,110132110,java.util.Map.class);
        this.submitTasks = MapUtil.get(map ,42834518,java.util.List.class);
        return this;
    }
}